package com.example.feilin.controller;

import java.util.HashMap;
import java.util.Map;

import com.example.feilin.entity.Material;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Page;

public class MaterialController extends Controller {

	public void index() {
		render("list.html");
	}
	
	public void json() {
		Page<Material> page = Material.me.paginate(getParaToInt("page", 1), getParaToInt("pagesize", 20));
		/*Map map = new HashMap();
		map.put("Rows", page.getList());
		map.put("Total", page.getTotalPage()); */
		renderJson(page);
	}
	
	public void form() {
		render("form.html");
	}
}
